home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_08_04
/
8n04054a
< prev
next >
Wrap
Text File
|
1990-03-18
|
842b
|
27 lines
*****Listing 2*****
double d[5] = {1., 2., 3., 4., 5.};
/* Assume this starts address 100 */
double *ch;
double e;
ch = d; /* 100 placed into ch */
*(ch++) = 5.; /* 5. placed in d[0]
ch incremented to 108.
++(*ch); /* Contents of d[1] (at address 108)
incremented by 1, to 3. */
*(++ch) = 7.; /* ch incremented to 116
7. placed in d[2] (at address 116) */
(*ch)++ /* The 7. at d[2] is incremented to 8. */
e = ++(*ch); /* The 8. at d[2] is incremented to 9.
9. is placed in e */
e = (*ch)++; /* The 9. at d[2] is placed in e
d[2] is incremented to 10. */